#pragma once

#include <QLineEdit>

class MyLineEdit : public QLineEdit
{
    Q_OBJECT
public:
    int row,col;        //存储所在的单元格让行列数，以便获取相对位置的item

    explicit MyLineEdit(QWidget *parent = nullptr);

    void paintEvent(QPaintEvent *event) override;

    void setIndex(int row,int col){this->row = row; this->col = col;};

    void mouseDoubleClickEvent(QMouseEvent *) override;

    void leaveEvent(QEvent *) override;

signals:

private:
    int charWidth;
};

